package com.ats.api.model

import com.ib.client.Contract
import collection.immutable.HashMap

/**
 * Created by IntelliJ IDEA.
 * User: mchapala
 * Date: 2/11/12
 * Time: 4:13 PM
 * To change this template use File | Settings | File Templates.
 */

object TickerIdMapper {

  private var tickerIdMap: Map[Int, Contract] = new HashMap[Int, Contract]();
  private var tickerIdMapInverse: Map[Contract, Int] = new HashMap[Contract, Int]();
  var i: Int = 0;

  def getTicketId(contract: Contract): Int = {
    return tickerIdMapInverse.get(contract).get
  }

  def getContract(tickerId: Int): Contract = {
    return tickerIdMap.get(tickerId).get
  }
}
